<template>
	<view class="flex-col page">
		<view class="u-flex u-p-20" @click="back">
			<u-icon size="40" name="arrow-left"></u-icon>
			<view class="u-flex-1 u-flex u-row-center">
				<text style="font-size: 30rpx; font-weight:bold">完善定稿施工图</text>
			</view>

		</view>
		<view class="flex-col group">
			<view class="justify-between items-start group_1">
				<view class="flex-col items-start group_2">
					<text class="text_1">定稿施工图完善</text>
					<text class="text_2">(含每个软装细节、上传最终版施工图）</text>
				</view>
				<view class="flex-col items-center text-wrapper" v-if="SGTstate">
					<text class="text_3" @click="wanshanSG(0)" >再次上传</text>
				</view>
				<view class="flex-col items-center text-wrapper_1" v-else>
				   <text class="text_5" @click="wanshanSG(1)" >去完善</text>
				</view>
			</view>
			<view class="flex-col group_3">
				<view class="justify-between group_4">
					<text class="text_4">主辅材清单完善 </text>
					<view class="flex-col items-center text-wrapper_1"  v-if="CLstate ==0">
						<text class="text_5" @click="wanshan(0)">去完善</text>
					
					</view>
					<view class="flex-col items-center text-wrapper" v-else >
					 	<text class="text_3" @click="wanshan(1)">再次上传</text>
					</view>
				</view>
			</view>
			<view class="justify-between group_5">
				<text class="text_7">合同工期</text>
				<view class="flex-col items-center text-wrapper_1" @click="hetong" v-if="Hstate ==0">
					<text class="text_5">去完善</text>
				</view>
				<view class="flex-col items-center text-wrapper" v-else >
				 	<text class="text_3" @click="hetong(1)">再次上传</text>
				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				id: '',
				state: '',
				ordersId: '',
				SGTstate: '',
				CLstate: '',
				listdate: '',
				Hstate:0
			};
		},
		onLoad(option) {
			this.id = option.id;
			this.state = option.state;
			this.ordersId = option.ordersId;
			
			this.init();

		},
		onShow()
		{
			this.init();
		},
		methods: {
			init()
			{
			this.getEX();	
			},
			hetong() {
				this.go('/pages/my/order/contractDuration?id=' + this.id+"&orderid="+this.ordersId)
			},
			wanshanSG(index) {
				if (index == 0) {
					this.go('/pages/my/order/picturePerfect?id=' + this.listdate.inspection.inspectionId + '&state=' + 0 +
						'&ordersId=' + this.ordersId + '&stateType=1')
				} else {
					this.go('/pages/my/order/picturePerfect?id=' + this.listdate.inspection.inspectionId + '&ordersId=' +
						this.ordersId + '&stateType=1')
				}

			},
			wanshan(index) {
				if (index == 0) {
					this.go('/pages/my/order/perfectDataXJ?id=' + this.listdate.inspection.inspectionId + '&state=' + 0 +
						'&ordersId=' + this.ordersId)
				} else {
					this.go('/pages/my/order/perfectDataXJ?id=' + this.listdate.inspection.inspectionId + '&ordersId=' +
						this.ordersId)
				}
			},
			back() {
				let pageNum = 2
				let pages = getCurrentPages(); // 当前页面
				let beforePage = pages[pages.length - pageNum]; // 前一个页面
				console.log(beforePage);
				uni.navigateBack({
					success: function() {
						beforePage.$vm.init();
					}

				});

			},
		getEX(){
			this.$http('mine.ordersEXL',{
				ordersId:this.ordersId
			}).then(res=>{
				if(res.code==200){
					console.log(res.data,'巡检订单详情');
					this.listdate = res.data;
					if(res.data.inspection.completePictures !=null){
						this.SGTstate = 1;
					
					}
					if(res.data.inspection.inspectionMaterialList !=null){
						this.CLstate = 1;
						
					}
					if(res.data.inspection.contractDuration !=null){
						this.Hstate = 1;
						
					}
				}
			}).catch(err=>{
				
			})
		}
		},
	};
</script>

<style scoped lang="scss">
	.u-p-20 {
		margin-top: 60rpx;
	}
	.text-wrapper_1 {
		padding: 4.5px 0 9.5px;
		background-color: #1d6aff;
		border-radius: 14px;
		width: 78px;
		height: 28px;
	}

	.text_5 {
		color: #ffffff;
		font-size: 12px;
		font-family: '.AppleSystemUIFont';
	}

	.page {
		background-color: #ffffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group {
		padding: 0 16px 402px;
		flex: 1 1 auto;
		overflow-y: auto;
	}

	.group_1 {
		padding: 14.5px 0 25.5px;
		border-bottom: solid 0.5px #eeeeee;
	}

	.group_3 {
		border-bottom: solid 0.5px #eeeeee;
	}

	.group_2 {
		height: 26px;
	}

	.text-wrapper {
		margin-top: 11px;
		padding: 5px 0 ;
		border-radius: 14px;
		background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/617a2ca7e4f1450011362b37/62b127f6d029820011531bae/16557836676407402372.png');
		background-position: 0% 0%;
		background-size: 100% 100%;
		background-repeat: no-repeat;
		width: 78px;
		height: 28px;
	}

	.group_4 {
		padding: 16px 0;
		border-bottom: solid 0.5px #eeeeee;
	}

	.group_5 {
		padding: 16px 0;
	}

	.text_1 {
		color: #191919;
		font-size: 16px;
		font-family: '.AppleSystemUIFont';
	}

	.text_2 {
		margin-top: 7px;
		color: #999999;
		font-size: 12px;
		font-family: '.AppleSystemUIFont';
	}

	.text_3 {
		color: #1d6aff;
		font-size: 12px;
		font-family: '.AppleSystemUIFont';
	}

	.text_4 {
		margin-top: 1.5px;
		color: #191919;
		font-size: 16px;
		font-family: '.AppleSystemUIFont';
	}

	.text_7 {
		margin-top: 1.5px;
		color: #191919;
		font-size: 16px;
		font-family: '.AppleSystemUIFont';
	}
</style>
